package com.chigga.common.core.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Positive;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 分页查询对象
 * @param <T> 查询参数类型
 * @author DefChigga
 */
@Schema(description = "分页查询对象")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageQuery<T> {
    /**
     * 当前页码
     */
    @Schema(description = "当前页码", example = "1")
    @Positive(message = "当前页码必须为正数")
    private Integer pageNum = 1;

    /**
     * 每页条数
     */
    @Schema(description = "每页条数", example = "10")
    @Positive(message = "每页条数必须为正数")
    private Integer pageSize = 10;

    /**
     * 查询参数
     */
    @Schema(description = "查询参数")
    private T params;
}
